package com.gdrcu.efp.cus.common;
/**
 * 将证件类型转换为人行征信的证件类型
 * @author tzy
 * 2018-05-29
 */
public enum CusRptCertTypeContant {

	CODE_10100("10100","0"),//身份证
	CODE_10200("10200","7"),//临时身份证
	CODE_10300("10300","1"),//户口本
	CODE_10400("10400","2"),//护照
	CODE_10501("10501","4"),//士兵证
	CODE_10502("10502","3"),//军官证
	CODE_10900("10900","8"),//外国人居留证
	CODE_10602("10602","9"),//警官证
	CODE_10701("10701","5"),//港澳居民来往内地通行证
	CODE_10702("10702","6"),//台湾居民来往大陆通行证
	CODE_10801("10801","A"),//香港身份证
	CODE_10802("10802","B"),//澳门身份证
	CODE_10803("10803","C"),//台湾身份证
	CODE_19999("19999","X"),//其它证件
	;
	private String key;
	private String value;
	public String getKey() {
		return key;
	}
	public String getValue() {
		return value;
	}
	private CusRptCertTypeContant(String key, String value) {
		this.key = key;
		this.value = value;
	}
	 public static String parse(String key) {
	        for(CusRptCertTypeContant certType : CusRptCertTypeContant.values()) {
	            if(certType.value.equals(key)) {
	                return certType.getKey();
	            }
	        }
	        return "X";
	 }
	 public static String parseKey(String key) {
	        for(CusRptCertTypeContant certType : CusRptCertTypeContant.values()) {
	            if(certType.key.equals(key)) {
	                return certType.getValue();
	            }
	        }
	        return "X";
	 }
}
